gen-random-keep generates random symbol patterns but enables you to control which keep-positions in a pattern are retained as they are. The possibilities are selected from a possibilities list which can be any symbol pattern. Keep-positions is a list of values that refer to the pattern, 1 referering to the first position etc. Keep-length determines the overall keep-pattern length - for example if you have keep-positions (1 3 5) and keep-length 8 then the overall keep-pattern will be (1 3 5 9 11 13 ..), but if the keep-length is 7 the keep-pattern will be (1 3 5 8 10 12 ..).
Note that if you want to use vector functions to calculate keep-positions you may do so without vector-to-list, since both vectors and lists are accepted, but use vector-round to be sure that the values are within reasonable limits. The positions may be expressed sequentially or non sequentially: (1 2 5 6) and (6 2 5 1) are equal. Example In the following example the positions (1 5 9) are kept as they are in the original pattern, and other positions are replaced with randomly picked symbols from the list (b c d). Next the keep-length is changed to 7.
(gen-random-keep 0.5 8 '(1 5) '(a a a a a a a a a a a a) '(b c d))
--> (a c d d a d d b a c c d)
(gen-random-keep 0.5 7 '(1 5) '(a a a a a a a a a a a a) '(b c d))
--> (a c d d a d d a b c c a)
(setq template (gen-fibonacci 6 'a 'b))
--> (a b a a b a b a a b a a b a b a a b a b a)
(gen-random-keep 0.9 8 '(1 3 5) template '(a a a a b c = = = =))